﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ProgramList.aspx.cs" Inherits="SD.Web.Iteration1.Program.ProgramList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function Check() {
            if (confirm("Do you want to make this Program active?") == true)
                return true;
            else
                return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentTitle" runat="server">
    <h2>
        PROGRAM LIST</h2>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Content" runat="server">
    <asp:UpdatePanel ID="UpdatePanelProgramList" runat="server">
        <ContentTemplate>
            <div class="grid740 simplebox">
                <div class="titleh">
                    <h3 class="sorting_range">
                        <asp:LinkButton ID="linkButtonAll" CommandName="all" OnCommand="FilterByLetters_Command"
                            runat="server">All</asp:LinkButton>
                        <asp:LinkButton ID="linkButton09" CommandName="09" OnCommand="FilterByLetters_Command"
                            runat="server">0-9</asp:LinkButton>
                        <asp:LinkButton ID="linkButtonAE" CommandName="ae" OnCommand="FilterByLetters_Command"
                            runat="server">A B C D E</asp:LinkButton>
                        <asp:LinkButton ID="linkButtonFJ" CommandName="fj" OnCommand="FilterByLetters_Command"
                            runat="server">F G H I J</asp:LinkButton>
                        <asp:LinkButton ID="linkButtonKN" CommandName="kn" OnCommand="FilterByLetters_Command"
                            runat="server">K L M N </asp:LinkButton>
                        <asp:LinkButton ID="linkButtonOR" CommandName="or" OnCommand="FilterByLetters_Command"
                            runat="server">O P Q R</asp:LinkButton>
                        <asp:LinkButton ID="linkButtonSV" CommandName="sv" OnCommand="FilterByLetters_Command"
                            runat="server">S T U V</asp:LinkButton>
                        <asp:LinkButton ID="linkButtonWZ" CommandName="wz" OnCommand="FilterByLetters_Command"
                            runat="server">W X Y Z</asp:LinkButton>
                        <span class="right">
                            <asp:LinkButton ID="CreateButton" runat="server" CssClass="hg-blue" OnClick="CreateButton_Click"
                                Text="CREATE">
                            </asp:LinkButton>
                            &nbsp;
                            <asp:CheckBox ID="CheckBoxInactive" runat="server" Text="Include In-active" AutoPostBack="True"
                                OnCheckedChanged="CheckBoxInactive_CheckedChanged" />
                        </span>
                    </h3>
                </div>
                <asp:GridView ID="GridViewProgram" CssClass="tablesorter" runat="server" AutoGenerateColumns="False"
                    AllowSorting="True" PageSize="10" OnSorting="GridViewProgram_Sorting" 
                    onrowdatabound="GridViewProgram_RowDataBound">
                    <Columns>
                        <asp:TemplateField HeaderText="Program Name" SortExpression="ProgramName">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButtonPROName" runat="server" CommandName='<%# Eval("ProgramId") %>'
                                    OnCommand="LinkButtonPROName_Command" CommandArgument='<%#Eval("IsActive") %>'
                                    Text='<%# Eval("ProgramName") %>'></asp:LinkButton>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" Width="133px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Description" SortExpression="Description">
                            <ItemTemplate>
                                <%# Eval("Description") %>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Contact" SortExpression="ContactName">
                            <ItemTemplate>
                                <%# Eval("Surname") %>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Is Active" SortExpression="IsActive">
                            <ItemTemplate>
                                <asp:Label ID="ProgramIsActive" runat="server" Text='<%# (bool) Eval("IsActive") ? "Yes" : "No" %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                    </Columns>
                    <PagerSettings Mode="NextPreviousFirstLast" />
                </asp:GridView>
                <table style="margin-top: 10px; margin-left: 10px;">
                    <tr style="line-height: 30px; padding: 20px 0;">
                        <% if (btnFirst.Visible == true)
                           { %>
                        <td style="background-color: #FFFFFF; color: 6C7D8C; vertical-align: top; word-wrap: break-word;">
                            <span style="background: url('img/simplebox-title-bg.png') repeat-x scroll center bottom transparent;
                                border: 1px solid #D6D6D6; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 1px #EDEDED;
                                color: #3E7CAC; padding:8px 0 8px 0;">
                                <asp:LinkButton ID="btnFirst" runat="server" OnClick="btnFirst_Click" 
                                Visible="false" Height="30px" Width="40px"><span style="font-size:14px; font-weight:bold; text-align:center; margin-left:12px;"><<</span></asp:LinkButton>
                            </span>
                        </td>
                        <%} %>
                        <% if (btnPrevious.Visible == true)
                           { %>
                        <td style="background-color: #FFFFFF; color: 6C7D8C; vertical-align: top; word-wrap: break-word;">
                            <span style="background: url('img/simplebox-title-bg.png') repeat-x scroll center bottom transparent;
                                border: 1px solid #D6D6D6; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 1px #EDEDED;
                                color: #3E7CAC; padding:8px 0 8px 0;">
                                <asp:LinkButton ID="btnPrevious" runat="server" OnClick="btnPrevious_Click" Height="30px" Width="30px"><span style="font-size:14px; font-weight:bold; text-align:center; margin-left:12px;"><</span></asp:LinkButton>
                            </span>
                        </td>
                        <%} %>
                        <% if (btnNext.Visible == true)
                           { %>
                        <td style="background-color: #FFFFFF; color: 6C7D8C; vertical-align: top; word-wrap: break-word;">
                            <span style="background: url('img/simplebox-title-bg.png') repeat-x scroll center bottom transparent;
                                border: 1px solid #D6D6D6; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 1px #EDEDED;
                                color: #3E7CAC; padding:8px 0 8px 0;">
                                <asp:LinkButton ID="btnNext" runat="server" OnClick="btnNext_Click" Height="30px" Width="30px"><span style="font-size:14px; font-weight:bold; text-align:center; margin-left:12px;">></span></asp:LinkButton>
                            </span>
                        </td>
                        <%} %>
                        <% if (btnLast.Visible == true)
                           { %>
                        <td style="background-color: #FFFFFF; color: 6C7D8C; vertical-align: top; word-wrap: break-word;">
                            <span style="background: url('img/simplebox-title-bg.png') repeat-x scroll center bottom transparent;
                                border: 1px solid #D6D6D6; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 1px #EDEDED;
                                color: #3E7CAC; padding:8px 0 8px 0;">
                                <asp:LinkButton ID="btnLast" runat="server" OnClick="btnLast_Click" Height="30px" Width="40px"><span style="font-size:14px; font-weight:bold; text-align:center; margin-left:12px;">>></span></asp:LinkButton>
                            </span>
                        </td>
                        <%} %>
                    </tr>
                </table>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
